<!--  在需要的页面使用该组件：pinia-demo.vue,-->
<template>
 <div class="box">
  <div>{{ userStore.name }}</div>
  <button @click="handleChange">修改Pinia</button>
 </div>
</template>

<script lang="ts" setup>
  import { useUserStore } from '@/store/user'

  const userStore = useUserStore()
  //修改Pinia的state
  const handleChange = () => {
    userStore.name=`"修改后的Pinia==>"${Date.now()};`
  };

</script>

<style lang="less" scoped>
.box{
  border:1px solid green
}
</style>
